<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>

<style>

</style>

<script>
	function Member(mid, irum){
		this.mid = mid;
		this.irum = irum;
		this.toString = function(){
			console.log(this.mid + ' ' + this.irum);
		}
	}
	
	var array = new Array();
	var sBtn;
	var oBtn;
	
	window.onload = function(){
		sBtn = document.getElementById("btnSave");
		oBtn = document.getElementById("btnOutput");
		
		sBtn.onclick = saveFunc;
		oBtn.onclick = outputFunc;
	}
	
	function saveFunc(){
		m = new Member(frm.mid.value, frm.irum.value);
		array.push(m);
		console.log("save", m.irum + "저장");
	}
	function outputFunc(){
		for(i=0; i<array.length; i++){
			array[i].toString();
		}
	}
	
</script>

</head>
<body>
<h3>성적을 입력하세요.</h3>
<form name="frm" action="" method="post">
	<ul>
		<li><label>아이디&nbsp;:&nbsp;</label><input type="search" name="mid">
		<li><label>성&nbsp;&nbsp;&nbsp;&nbsp;명&nbsp;:&nbsp;</label><input type="search" name="irum">
	</ul>
	<p/>
	<input type="button" value="SAVE" id="btnSave">
	<input type="button" value="OUTPUT" id="btnOutput">
</form>
</body>
</html>